package com.syxp.pda.core.util;

import java.util.List;

import com.syxp.pda.core.xls.TitleInfoBean;
import com.syxp.pda.core.xls.TitleInfoFactory;

public abstract class XlsBuilder {

	private TitleInfoFactory factory ;
	
	public TitleInfoFactory getFactory() {
		return factory;
	}


	public void setFactory(TitleInfoFactory factory) {
		this.factory = factory;
	}

	public abstract void xlsBuilder(TitleInfoBean title ,List<String[]> list) throws Exception;
	
	public void xlsBuilder(String type ,String startTime,String endTime, List<String[]> list){
		TitleInfoBean title = getFactory().createTitle(type) ;
		title.builderFileName(startTime, endTime) ;
		try {
			xlsBuilder(title,list) ;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void xlsBuilder(String type ,List<String[]> list) {
		TitleInfoBean title = getFactory().createTitle(type) ;
		try {
			xlsBuilder(title,list) ;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
